<?php
include_once("include/include.php.inc");
html_header("Assign Ticket");

/*   $backlink=getenv('HTTP_REFERER');*/

   if (isset($_GET['tic_no'])) {
      $mtic = $_GET['tic_no'];
      $result = "SELECT * FROM chd_tickets WHERE chd_tickets.tic_no=$mtic";
      $action = mysql_query($result);
/*               if (FALSE === ($action = mysql_query($result)))
              {
                  print mysql_error()."<br />";
                  print $result;
              }*/
      $edit_row = mysql_fetch_array($action);
      }
?>

      <form action="update_tic.php" method="post"
      <br>
      <h2>Assign Ticket</h2>
      <br>
      <b>Ticket No:</b>
      <?php print $_GET['tic_no']; ?>
      <input type="hidden" name="tic_no" value="<?php print $_GET['tic_no']; ?>"
      <br>
      <b>User Name:</b>
      <?php print $edit_row["tic_user"]; ?>
      <br>
      <b>Ticket Date:</b>
      <?php print $edit_row["tic_date"]; ?>
      <br>
      <b>Problem Description:</b>
      <?php print $edit_row["tic_problem"]; ?>
      <br>
      <b>User's IP Address:</b>
      <?php print $edit_row["tic_ip"]; ?>
      <br><br>
      <h2>Assign/Select Support Person For This Ticket</h2>

      <?php
           $result_sup = mysql_query( "SELECT * FROM ssts_support")
           or die("SELECT Error: ".mysql_error());

           $num_rows = mysql_num_rows($result_sup);

           while ($row = mysql_fetch_assoc($result_sup)){
                 extract($row);
                 print "<INPUT TYPE=\"RADIO\" NAME=\"as_sup\" VALUE=\"$sup_name\">$sup_name</INPUT>";
				 //print "<INPUT TYPE=\"HIDDEN\" NAME=\"as_sup_name\" VALUE=\"$sup_name\">";
                 print "<br>";
                 }
      ?>
      <br><br>
      <input type="submit" value=" Assign ">


      </form>

<?php
   html_footer();
?>
